#include "xmarket.h"
#include "xbiz.h"
#include "pkg.h"

xmarket_t::xmarket_t(/* args */)
{
}

xmarket_t::~xmarket_t()
{
}

int xmarket_t::init(){
    return 0;
}

int xmarket_t::uninit(){
    return 0;
}

int xmarket_t::add_biz(uint32_t tid, std::shared_ptr<xbiz_t> processor) {
    xbiz_dict_[tid] = processor;
    return 0;
}


int xmarket_t::handle_input(pkg& data)
{
    auto got = xbiz_dict_.find(data.tid);

    if (got == xbiz_dict_.end()) {
        return -1;
    }

    auto ret = got->second->handle_input(data);
    if(ret != 0) {
        return ret;
    }
    return 0;
}



// 如果互换

// 清算模型（双边，还是其他）

// 会员号。。。。。